package book;

public class Book {
    private String name;//书名
    private String author;//作者
    private int prince;//价格
    private String typr;//书的类型
    private boolean isBorrowed;//是否被借出

    public Book(String name, String author, int prince, String typr) {
        this.name = name;
        this.author = author;
        this.prince = prince;
        this.typr = typr;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPrince() {
        return prince;
    }

    public void setPrince(int prince) {
        this.prince = prince;
    }

    public String getTypr() {
        return typr;
    }

    public void setTypr(String typr) {
        this.typr = typr;
    }

    public boolean isBorrowed() {
        return isBorrowed;
    }

    public void setBorrowed(boolean borrowed) {
        isBorrowed = borrowed;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", prince=" + prince +
                ", typr='" + typr + '\'' +
                ((isBorrowed == true) ? "已借出" : "未借出")+
                //", isBorrowed=" + isBorrowed +
                '}';
    }
}
